package com.baitiaojun.bulletscreen.api.impl;

import com.baitiaojun.api.domain.video.BulletScreen;
import com.baitiaojun.api.exception.ConditionException;
import com.baitiaojun.api.vo.JsonRes;
import com.baitiaojun.bulletscreen.api.BulletScreenApi;
import com.baitiaojun.bulletscreen.service.BulletScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;

/**
 * @类名 BulletScreenApiImpl
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2023/1/1 17:13
 * @版本 1.0
 */
@RestController
public class BulletScreenApiImpl implements BulletScreenApi {

    @Autowired
    @Qualifier("bulletScreenServiceImpl")
    private BulletScreenService bulletScreenService;

    @Override
    public JsonRes getBulletScreenList(Long videoId, String startTime, String endTime) throws ConditionException, ParseException {
        List<BulletScreen> bulletScreens = bulletScreenService.getBulletScreen(videoId, startTime, endTime);
        return JsonRes.builder().success().data(bulletScreens);
    }
}
